<?PHP use_javascript("/js/i18n/grid.locale-cn.js") ?>
<?PHP use_javascript("/js/jquery.jqGrid.min.js") ?>
<?PHP use_stylesheet("/css/ui.jqgrid.css") ?>
<?PHP include_partial("rightnow") ?>



<script type="text/javascript">
    $(document).ready(function(){

        $("#table_stkdept_list").jqGrid({
            url: "<?PHP echo url_for("stkdept/getStkDeptList.json") ?>",
            datatype: "json",
            width: 700,
            colNames:["Id","库存单位编号","库存单位名称","描述","建立人员","最后维护日期"],
            colModel:[
                {name: "id", hidden: true},
                {name: "stk_no"},
                {name: "stk_name"},
                {name: "stk_desc", hidden: true},
                {name: "stk_opr"},
                {name: "updated_at"},
            ],
            rowNum: 20,
            rowList: [10,20,30],
            pager: "#pager_stkdept_list",
            sortname: 'id',
            viewrecords: true,
            sortorder: "desc",
            caption: "&nbsp;"
        });
        $("#table_stkdept_list").jqGrid('navGrid','#pager_stkdept_list',{edit:false, add:false, del:false })
            .jqGrid('navButtonAdd',"#pager_stkdept_list",{
                caption:"显示/隐藏列",
                id:"show_hide_column",
                onClickButton: function() {
                    $('#table_stkdept_list').setColumns()
                }
        });


    });

</script>

<!--
<h1>Stk depts List</h1>


<table>
  <thead>
    <tr>
      <th>Id</th>
      <th>Acct set</th>
      <th>Stk no</th>
      <th>Stk name</th>
      <th>Stk desc</th>
      <th>Stk opr</th>
      <th>Created at</th>
      <th>Updated at</th>
    </tr>
  </thead>
  <tbody>
    <?php //foreach ($stk_depts as $stk_dept): ?>
    <tr>
      <td><a href="<?php //echo url_for('stkdept/edit?id='.$stk_dept->getId()) ?>"><?php //echo $stk_dept->getId() ?></a></td>
      <td><?php //echo $stk_dept->getAcctSetId() ?></td>
      <td><?php //echo $stk_dept->getStkNo() ?></td>
      <td><?php //echo $stk_dept->getStkName() ?></td>
      <td><?php //echo $stk_dept->getStkDesc() ?></td>
      <td><?php //echo $stk_dept->getStkOpr() ?></td>
      <td><?php //echo $stk_dept->getCreatedAt() ?></td>
      <td><?php //echo $stk_dept->getUpdatedAt() ?></td>
    </tr>
    <?php //endforeach; ?>
  </tbody>
</table>

  <a href="<?php //echo url_for('stkdept/new') ?>">New</a>

-->

<div id="box">
    <h3>库存单位浏览</h3>
    <table id="table_stkdept_list" width="100%" align="center">
    </table>
    <div id="pager_stkdept_list"></div>
</div>
<br />

